﻿Namespace Muhasebe.HesapPlani
	Public Module Functions

		Function Liste(Token As Token) As Recordset
			Return Token.OpenSQL("select * from muhasebe..hesplan order by hesapno")
		End Function

		Function Oku(Token As Token, hesapno As String) As Recordset
			Return Token.OpenSQL("select * from muhasebe..hesplan where hesapno = @hesapno", hesapno)
		End Function

		Sub Kaydet(Token As Token, hesapno As String, hesapadi As String)
			Dim Rs As Recordset = Token.OpenSQL("select * from muhasebe.dbo.hesplan where hesapno = @hesapno", hesapno)
			Rs.SetValues("hesapadi,tali,ana,grp,hesapadi", hesapno, Mid(hesapno, 1, 5), Mid(hesapno, 1, 3), Mid(hesapno, 1, 1), hesapadi)
			Rs.Save()
		End Sub

		Sub Sil(Token As Token, hesapno As String)
			Token.ExecSQL("delete from muhasebe..hesplan where hesapno = @hesapno", hesapno)
		End Sub

	End Module
End Namespace

